import React from 'react'
import styles from './indexPage.less'
import Header from "@/components/Header/Header"
import Footer from "@/components/Footer/Footer"
import {withRouter} from 'dva/router'

// 学习特殊处理
function isStudy(props) {
  const { location: { pathname } } = props
  return (
    !pathname.includes('study') ?
      <div className={styles.index}>
        <Header/>
        <div className={styles.container}>
          {props.children}
          <Footer/>
        </div>
      </div> :
      <div style={{height: '100%'}}>
        {props.children}
      </div>
  )
}

function IndexPage(props) {
  return (
    isStudy(props)
  );
}

IndexPage.propTypes = {
};

export default withRouter(IndexPage)
